package _6ShiPeiQi;

import _6ShiPeiQi.adapter.MediaAdapter;

/**
 * @AudioPlayer: 媒体播放器的 实现类
 * @author: ZBoHang
 * @time: 2021/9/7 14:28
 */
public class AudioPlayer implements MediaPlayer {

    private MediaAdapter mediaAdapter;

    @Override
    public void play(String audioType, String fileName) {
        if ("mp3".equalsIgnoreCase(audioType)) {
            System.out.println(audioType + " -- 内置支持!!!");
        }else if ("vlc".equalsIgnoreCase(audioType) || "mp4".equalsIgnoreCase(audioType)) {
            mediaAdapter = new MediaAdapter(audioType);
            mediaAdapter.play(audioType, fileName);
        } else {
            System.out.println("Invalid Media Type!!!");
        }

    }
}
